﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.SessionState;

namespace TransFormer.Web.admin
{
    /// <summary>
    /// UserInfoRemove 的摘要说明
    /// </summary>
    public class UserInfoRemove : IHttpHandler,IRequiresSessionState
    {
        private BLL.UserInfo _bll = new BLL.UserInfo();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var idsStr = context.Request["ids"] ?? string.Empty;
            if (idsStr == null)
            {
                return;
            }
            if (Regex.IsMatch(idsStr, @"[^\d,]+")) return;
            if (_bll.DeleteList(idsStr))
                context.Response.Write("true");
        }
        
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}